package com.cayden.base.utils;

import com.cayden.base.utils.constants.OSConstants;
import org.apache.commons.lang3.StringUtils;

/**
 * 操作系统信息获取工具类
 *
 * @author Shaun Wu
 * @date 2021/06/23 08:43
 */
public class SystemUtils {

    private static String OS_NAME = System.getProperty("os.name").toLowerCase();

    private static String OS_ARCH = System.getProperty("os.arch").toLowerCase();


    public static String getOsName(){
        if (StringUtils.isBlank(OS_NAME)) return OSConstants.WINDOWS;
        if (OS_NAME.contains(OSConstants.MAC_OS))return OSConstants.MAC_OS;
        if (OS_NAME.contains(OSConstants.WINDOWS))return OSConstants.WINDOWS;
        return OSConstants.LINUX;
    }

}
